#!/bin/sh -e
#
# When run from a travis build, prints the files which have changed in the
# current pull request, if any. Otherwise it prints files which have changed
# in the commit range associated with the build.
#

if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
    git show --pretty=format: --name-only "$TRAVIS_COMMIT_RANGE"|sort|uniq
elif [ -n "$TRAVIS_PULL_REQUEST" ]; then
    git diff --name-only "$TRAVIS_COMMIT" "$TRAVIS_BRANCH"
fi
